package com.szrt.day20170421.test;


import static org.junit.Assert.*;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

import org.junit.Before;
import org.junit.Test;

import com.szrt.day20170421.entity.Student;
import com.szrt.day20170421.service.StudentService;
import com.szrt.day20170421.service.impl.StudentServiceImpl;
import com.szrt.day20170421.util.MenuUtil;

public class EaxmClient {
	
	private Scanner scanner= new Scanner(System.in);
	private StudentService service = new StudentServiceImpl();
	private List<Student> studentList = new ArrayList<Student>();
	
	
	@Before
	public void testName() throws Exception {
		service.init(studentList);
	}
	
	@Test
	public void examTest() throws Exception {
		
		
		
		
		
		while(true){
			MenuUtil.printMainMenu();
			
			int operator01 =scanner.nextInt();
			
			
			if(operator01 ==1){
				//1 管理员登录
				
				MenuUtil.adminLogin(scanner,service,studentList);
				
				
			}else if(operator01 ==2){
				//2考生登录
				MenuUtil.studentLogin(scanner,service,studentList);
				
			}else{
				//退出
				break;
				
			}
		}
	}

}
